package view;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.border.EtchedBorder;
import javax.swing.ListSelectionModel;
import javax.swing.JRadioButton;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import java.awt.Dimension;
import java.awt.Rectangle;
import javax.swing.JList;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.UIManager;
import javax.swing.ImageIcon;
import javax.swing.AbstractListModel;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;

public class TelaNovoCliente {

	private JFrame frmClientes;
	private JTextField tfNome;
	private JTextField tfEndereco;
	private JTextField tfTelefone;
	private JTextField tfCodigo;
	private JTextField tfComplemento;
	private JTextField tfCpf;
	private JTextField tfTelefone1;
	private JTextField tfTelefone2;
	private JTextField tfReferencia;
	private JTextField tfDataNasc;
	private JTextField tfNumero;
	private JTextField tfCep;
	private JTextField tfCidade;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaNovoCliente window = new TelaNovoCliente();
					window.frmClientes.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public TelaNovoCliente() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmClientes = new JFrame();
		frmClientes.setResizable(false);
		frmClientes.setTitle("CLIENTES");
		frmClientes.setBounds(100, 100, 1024, 700);
		frmClientes.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frmClientes.getContentPane().setLayout(null);
		
		JPanel panelMenu = new JPanel();
		panelMenu.setBounds(10, 28, 145, 533);
		frmClientes.getContentPane().add(panelMenu);
		
		JButton button = new JButton("Clientes");
		panelMenu.add(button);
		
		JButton button_1 = new JButton("Produtos");
		panelMenu.add(button_1);
		
		JButton button_2 = new JButton("Administra\u00E7\u00E3o");
		panelMenu.add(button_2);
		
		JButton button_3 = new JButton("Pedidos");
		panelMenu.add(button_3);
		
		JPanel panelCadastroCliente = new JPanel();
		panelCadastroCliente.setBounds(208, 63, 800, 600);
		frmClientes.getContentPane().add(panelCadastroCliente);
		panelCadastroCliente.setLayout(null);
		
		JTextArea textArea = new JTextArea();
		textArea.setFont(new Font("Tahoma", Font.PLAIN, 14));
		textArea.setText("F2 = NOVO, F3 = PESQUISAR, F4 = ALTERAR, F5 = EXCLUIR, ESC = CANCELAR E SAIR");
		textArea.setBounds(10, 605, 780, 20);
		panelCadastroCliente.add(textArea);
		
		tfNome = new JTextField();
		tfNome.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfNome.setColumns(10);
		tfNome.setBounds(10, 143, 620, 20);
		panelCadastroCliente.add(tfNome);
		
		JLabel lblNome = new JLabel("Nome:");
		lblNome.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblNome.setBounds(10, 123, 47, 14);
		panelCadastroCliente.add(lblNome);
		
		tfEndereco = new JTextField();
		tfEndereco.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfEndereco.setColumns(10);
		tfEndereco.setBounds(150, 196, 530, 20);
		panelCadastroCliente.add(tfEndereco);
		
		JLabel lblEndereco = new JLabel("Endere\u00E7o:");
		lblEndereco.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblEndereco.setBounds(150, 177, 69, 17);
		panelCadastroCliente.add(lblEndereco);
		
		tfTelefone = new JTextField();
		tfTelefone.setFont(new Font("Tahoma", Font.PLAIN, 15));
		tfTelefone.setColumns(10);
		tfTelefone.setBounds(150, 56, 150, 35);
		panelCadastroCliente.add(tfTelefone);
		
		JLabel lblTelefone = new JLabel("Telefone:");
		lblTelefone.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblTelefone.setBounds(150, 36, 80, 14);
		panelCadastroCliente.add(lblTelefone);
		
		tfCodigo = new JTextField();
		tfCodigo.setFont(new Font("Tahoma", Font.PLAIN, 15));
		tfCodigo.setEnabled(false);
		tfCodigo.setEditable(false);
		tfCodigo.setColumns(10);
		tfCodigo.setBounds(10, 56, 100, 35);
		panelCadastroCliente.add(tfCodigo);
		
		JLabel lblCodigo = new JLabel("C\u00F3digo");
		lblCodigo.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCodigo.setBounds(10, 33, 50, 20);
		panelCadastroCliente.add(lblCodigo);
		
		JLabel lblBairro = new JLabel("Bairro:");
		lblBairro.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblBairro.setBounds(220, 232, 46, 14);
		panelCadastroCliente.add(lblBairro);
		
		tfComplemento = new JTextField();
		tfComplemento.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfComplemento.setColumns(10);
		tfComplemento.setBounds(10, 252, 200, 20);
		panelCadastroCliente.add(tfComplemento);
		
		JButton btnNovo = new JButton("Novo");
		btnNovo.setFont(new Font("Tahoma", Font.PLAIN, 14));
		btnNovo.setBounds(10, 420, 80, 80);
		panelCadastroCliente.add(btnNovo);
		
		JButton btnAlterar = new JButton("Alterar");
		btnAlterar.setFont(new Font("Tahoma", Font.PLAIN, 14));
		btnAlterar.setBounds(100, 420, 80, 80);
		panelCadastroCliente.add(btnAlterar);
		
		JButton btnExcluir = new JButton("Excluir");
		btnExcluir.setFont(new Font("Tahoma", Font.PLAIN, 14));
		btnExcluir.setBounds(190, 420, 80, 80);
		panelCadastroCliente.add(btnExcluir);
		
		JButton btnSalvar = new JButton("SALVAR");
		btnSalvar.setFont(new Font("Tahoma", Font.PLAIN, 14));
		btnSalvar.setBounds(610, 420, 90, 80);
		panelCadastroCliente.add(btnSalvar);
		
		JButton btnSair = new JButton("SAIR");
		btnSair.setFont(new Font("Tahoma", Font.PLAIN, 14));
		btnSair.setBounds(710, 420, 80, 80);
		panelCadastroCliente.add(btnSair);
		
		JLabel lblClientes = new JLabel("CLIENTES");
		lblClientes.setHorizontalAlignment(SwingConstants.CENTER);
		lblClientes.setFont(new Font("Verdana", Font.BOLD, 20));
		lblClientes.setBounds(10, 0, 780, 25);
		panelCadastroCliente.add(lblClientes);
		
		JLabel lblComplemento = new JLabel("Complemento:");
		lblComplemento.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblComplemento.setBounds(10, 227, 100, 19);
		panelCadastroCliente.add(lblComplemento);
		
		JButton btnPesquisar = new JButton("");
		btnPesquisar.setIcon(new ImageIcon("C:\\Users\\Railson\\Documents\\Eclipse Workspace\\Pizzaria\\Pizzaria\\img\\Search_Tip1_32.png"));
		btnPesquisar.setBounds(320, 36, 55, 55);
		panelCadastroCliente.add(btnPesquisar);
		
		tfCpf = new JTextField();
		tfCpf.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfCpf.setBounds(640, 143, 150, 20);
		panelCadastroCliente.add(tfCpf);
		tfCpf.setColumns(10);
		
		JLabel lblCpf = new JLabel("CPF:");
		lblCpf.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCpf.setBounds(640, 123, 46, 14);
		panelCadastroCliente.add(lblCpf);
		
		JLabel lblTelefone1 = new JLabel("Telefone 1:");
		lblTelefone1.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblTelefone1.setBounds(680, 283, 93, 14);
		panelCadastroCliente.add(lblTelefone1);
		
		tfTelefone1 = new JTextField();
		tfTelefone1.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfTelefone1.setColumns(10);
		tfTelefone1.setBounds(680, 303, 110, 20);
		panelCadastroCliente.add(tfTelefone1);
		
		JLabel lblTelefone2 = new JLabel("Telefone 2:");
		lblTelefone2.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblTelefone2.setBounds(680, 334, 90, 14);
		panelCadastroCliente.add(lblTelefone2);
		
		tfTelefone2 = new JTextField();
		tfTelefone2.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfTelefone2.setColumns(10);
		tfTelefone2.setBounds(680, 354, 110, 20);
		panelCadastroCliente.add(tfTelefone2);
		
		tfReferencia = new JTextField();
		tfReferencia.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfReferencia.setBounds(246, 303, 420, 20);
		panelCadastroCliente.add(tfReferencia);
		tfReferencia.setColumns(10);
		
		JLabel lblReferencia = new JLabel("Refer\u00EAncia:");
		lblReferencia.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblReferencia.setBounds(246, 283, 69, 14);
		panelCadastroCliente.add(lblReferencia);
		
		tfDataNasc = new JTextField();
		tfDataNasc.setToolTipText("");
		tfDataNasc.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfDataNasc.setHorizontalAlignment(SwingConstants.CENTER);
		tfDataNasc.setText("  /  /    ");
		tfDataNasc.setBounds(150, 303, 86, 20);
		panelCadastroCliente.add(tfDataNasc);
		tfDataNasc.setColumns(10);
		
		JLabel lblDataNasc = new JLabel("Data Nasc.");
		lblDataNasc.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblDataNasc.setBounds(150, 283, 76, 14);
		panelCadastroCliente.add(lblDataNasc);
		
		JLabel lblTipo = new JLabel("Tipo:");
		lblTipo.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblTipo.setBounds(10, 174, 46, 20);
		panelCadastroCliente.add(lblTipo);
		
		JLabel lblNumero = new JLabel("N\u00FAmero:");
		lblNumero.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblNumero.setBounds(690, 174, 71, 20);
		panelCadastroCliente.add(lblNumero);
		
		tfNumero = new JTextField();
		tfNumero.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfNumero.setBounds(690, 196, 100, 20);
		panelCadastroCliente.add(tfNumero);
		tfNumero.setColumns(10);
		
		JLabel lblCep = new JLabel("CEP:");
		lblCep.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCep.setBounds(10, 283, 46, 14);
		panelCadastroCliente.add(lblCep);
		
		tfCep = new JTextField();
		tfCep.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfCep.setBounds(10, 303, 130, 20);
		panelCadastroCliente.add(tfCep);
		tfCep.setColumns(10);
		
		JLabel lblCidade = new JLabel("Cidade:");
		lblCidade.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCidade.setBounds(430, 232, 77, 14);
		panelCadastroCliente.add(lblCidade);
		
		tfCidade = new JTextField();
		tfCidade.setFont(new Font("Tahoma", Font.PLAIN, 13));
		tfCidade.setBounds(430, 252, 300, 20);
		panelCadastroCliente.add(tfCidade);
		tfCidade.setColumns(10);
		
		JLabel lblUf = new JLabel("UF:");
		lblUf.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblUf.setBounds(740, 232, 29, 14);
		panelCadastroCliente.add(lblUf);
		
		JTextArea taObservacao = new JTextArea();
		taObservacao.setFont(new Font("Tahoma", Font.PLAIN, 13));
		taObservacao.setBounds(100, 334, 446, 75);
		panelCadastroCliente.add(taObservacao);
		
		JLabel lblObservacao = new JLabel("Observa\u00E7\u00E3o:");
		lblObservacao.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblObservacao.setBounds(10, 334, 110, 20);
		panelCadastroCliente.add(lblObservacao);
		
		JTextArea taAtalhosCadastros = new JTextArea();
		taAtalhosCadastros.setText("F2 = NOVO, F3 = PESQUISAR, F4 = ALTERAR, F5 = EXCLUIR, ESC = CANCELAR E SAIR");
		taAtalhosCadastros.setFont(new Font("Tahoma", Font.PLAIN, 15));
		taAtalhosCadastros.setBounds(10, 531, 780, 58);
		panelCadastroCliente.add(taAtalhosCadastros);
		
		JLabel lblAtalhosDoTeclado = new JLabel("Atalhos do Teclado:");
		lblAtalhosDoTeclado.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblAtalhosDoTeclado.setBounds(10, 511, 150, 14);
		panelCadastroCliente.add(lblAtalhosDoTeclado);
		
		JList ltDesconto = new JList();
		ltDesconto.setFont(new Font("Tahoma", Font.PLAIN, 13));
		ltDesconto.setModel(new AbstractListModel() {
			String[] values = new String[] {"Sem desconto", "5%", "10%", "15%"};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		ltDesconto.setBounds(556, 354, 110, 20);
		panelCadastroCliente.add(ltDesconto);
		
		JLabel lblDesconto = new JLabel("Desconto:");
		lblDesconto.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblDesconto.setBounds(556, 331, 77, 20);
		panelCadastroCliente.add(lblDesconto);
		
		JComboBox cbxTipo = new JComboBox();
		cbxTipo.setFont(new Font("Tahoma", Font.PLAIN, 13));
		cbxTipo.setModel(new DefaultComboBoxModel(new String[] {"Rua", "Avenida", "Alameda", "Bloco", "Conjunto", "Travessa"}));
		cbxTipo.setBounds(10, 196, 130, 20);
		panelCadastroCliente.add(cbxTipo);
		
		JComboBox cbxUf = new JComboBox();
		cbxUf.setFont(new Font("Tahoma", Font.PLAIN, 13));
		cbxUf.setModel(new DefaultComboBoxModel(new String[] {"SP", "AC", "AL", "AM", "AP", "BA", "CE", "ES", "GO", "MA", "MG", "MS", "MT", "PA", "PB", "PE", "PI", "PR", "RJ", "RN", "RO", "RR", "RS", "SC", "SE", "TO"}));
		cbxUf.setBounds(740, 252, 50, 20);
		panelCadastroCliente.add(cbxUf);
		
		JComboBox cbxBairro = new JComboBox();
		cbxBairro.setEditable(true);
		cbxBairro.setFont(new Font("Tahoma", Font.PLAIN, 13));
		cbxBairro.setModel(new DefaultComboBoxModel(new String[] {"Cohab Raposo Tavares", "Parque Yp\u00EA", "Jd. Santa Maria"}));
		cbxBairro.setBounds(220, 252, 200, 20);
		panelCadastroCliente.add(cbxBairro);
	}
}
